//
// File  : CustomerDatabase.h
// Team  : Dangling Pointers
// Class : CST 236 - Software Testing
//
// Header file for the CustomerDatabase class.
// CustomerDatabase is a container of Customer
// objects.
//

#ifndef CUSTOMERDATABASE_H
#define CUSTOMERDATABASE_H

#include <map>
#include <iterator>
#include "Customer.h"


// typedefs to simplify stl syntax
typedef std::map<std::string, Customer> CustomerMap;
typedef std::map<std::string, Customer>::iterator CustomerMapIter;
typedef std::map<std::string, Customer>::const_iterator CustomerMapIterC;

class CustomerDatabase
{
	CustomerMap      m_database;

public:

	// constructor
	CustomerDatabase();

	// accessor
	const Customer&  getCustomer(const std::string&) const;

	// mutators
	void             addCustomer(const std::string&, const Customer&);
	void             changeCustomerPhone(const std::string&, const std::string&);
	void             changeCustomerEmail(const std::string&, const std::string&);
	void             updateCustomerFlight(const std::string&, const std::string&);

	// print all customers to console
	void             printCustomers() const;

private:

	// prevent CustomerDatabase from being copied
	CustomerDatabase(const CustomerDatabase&);
	CustomerDatabase& operator=(const CustomerDatabase&);
};

#endif
